]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Ensure our drag actor is positioned over the cursor
authorColin Walters <walters@verbum.org>
Wed, 10 Mar 2010 00:15:43 +0000 (19:15 -0500)
committerColin Walters <walters@verbum.org>
Tue, 16 Mar 2010 14:59:42 +0000 (10:59 -0400)
Previously we were looking at the source size, which is
not necessarily the same as the drag actor size.

https://bugzilla.gnome.org/show_bug.cgi?id=607821

js/ui/dnd.js

index 717ea18bd6853ea9ebaba058a5403ebe4eb25d75..4ce2a0bf7193cddee8c420c49023b43006fd83d3 100644 (file)
@@ -154,10 +154,9 @@ _Draggable.prototype = {
                 // the dragActor over it. Otherwise, center it
                 // around the pointer
                 let [sourceX, sourceY] = this._dragActorSource.get_transformed_position();
-                let [sourceWidth, sourceHeight] = this._dragActorSource.get_transformed_size();
                 let x, y;
-                if (stageX > sourceX && stageX <= sourceX + sourceWidth &&
-                    stageY > sourceY && stageY <= sourceY + sourceHeight) {
+                if (stageX > sourceX && stageX <= sourceX + this._dragActor.width &&
+                    stageY > sourceY && stageY <= sourceY + this._dragActor.height) {
                     x = sourceX;
                     y = sourceY;
                 } else {